package com.example.combwyaq.visualinterface.live.entity;

import com.example.combwyaq.entity.TokenEntity;
import com.example.combwyaq.mvp.model.entity.BaseEntity;
import com.google.gson.Gson;

import org.json.JSONArray;
import org.json.JSONException;

import java.util.ArrayList;
import java.util.List;

public class LiveEntity extends BaseEntity {

        public String values;

        public List<Values> getValues(){
            if (values==null)
                return null;
            List<Values> list=new ArrayList<>();
            try {
                JSONArray jsonArray=new JSONArray(values);
                for (int i = 0; i < jsonArray.length(); i++) {
                    String str = jsonArray.getString(i);
                    Values entity=new Gson().fromJson(str,Values.class);
                    list.add(entity);
                }
            } catch (JSONException e) {
                e.printStackTrace();
            }
            return list;

        }

    public static class Values{
        public long live_id;
        public long live_time;
        public String live_img;
        public String live_title;
        public String live_url;
        public int live_fabulous;
    }
}
